﻿import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppCommonModule } from '@app/shared/common/app-common.module';
import { UtilsModule } from '@shared/utils/utils.module';
import { CountoModule } from 'angular2-counto';
import { ModalModule, TabsModule, TooltipModule, BsDropdownModule, PaginationModule } from 'ngx-bootstrap';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { TreeBaseComponent } from './tree-structure/tree-base.component';

import {
    BsDatepickerModule,
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService
} from 'ngx-bootstrap/datepicker';
import { NgxBootstrapDatePickerConfigService } from 'assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service';
import { CostDisplayRoutingModule } from './cost-display-routing.module';
import { TableModule } from 'primeng/table';
import { CalendarModule, PaginatorModule, ContextMenuModule } from 'primeng/primeng';
import { TreeModule } from 'primeng/tree';
import { CostQueryComponent } from './cost-query/cost-query.component';
import { CostResultComponent } from './cost-result/cost-result.component';
import { AssemTreeComponent } from './shared/assem-tree/assem-tree.component';
import { CostQueryDetailComponent } from './cost-query/cost-query-detail.component';
import { PiciQueryComponent } from './pici-query/pici-query.component';
NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales();

@NgModule({
    imports: [
        CommonModule,
        FormsModule,
        ModalModule,
        TabsModule,
        TooltipModule,
        AppCommonModule,
        UtilsModule,
        CountoModule,
        TableModule,
        CalendarModule,
        ContextMenuModule,
        NgxChartsModule,
        CostDisplayRoutingModule,
        BsDatepickerModule.forRoot(),
        BsDropdownModule.forRoot(),
        TreeModule,
        PaginationModule,
        PaginatorModule
    ],
    declarations: [
        TreeBaseComponent,
        CostResultComponent,
        CostQueryComponent,
        CostQueryDetailComponent,
        AssemTreeComponent,
        PiciQueryComponent
    ],
    providers: [
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDaterangepickerConfig
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale
        }
    ]
})
export class CostDisplayModule {}
